<template>
	<el-input :value="value" @blur="blur" @input="changeValue" ref="field" :placeholder="item.hint" :disabled="disabled" :min="item.minNumber" :max="item.maxNumber">
		<template slot="append" v-if="item.unit">{{item.unit}}</template>
	</el-input>
</template>

<script lang="ts">
import { Component, Mixins } from 'vue-property-decorator';
import widgetCommon from '../common/widgetCommon';
@Component({})
export default class extends Mixins(widgetCommon) {
  public blur () {
    let value = this.value;
    if (value && !isNaN(Number(value))) {
      value = Number(value).toFixed(this.item.decimalPoint);
    }
    this.changeValue(value);
    // this.$nextTick(() => {
    //   this.$emit('fieldBlur', value);
    // });
  }
}
</script>
